

public class Test {
    static  int a = 1;
    static void sum (){
        while (a == 1){

        }
    }


    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            sum();
        }).start();
        Thread.sleep(200);
        a = 2;

    }

}
